package cn.vc.auth.websocket;

import cn.redcoral.messageplus.port.MessagePlusBase;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.websocket.*;

@Slf4j
@Service
public class WebSocketServer implements MessagePlusBase {
    /**
     * 连接建立成功调用的方法
     * @return 唯一标识
     */
    @Override
    public String onOpen(Session session, String sid) {
        return sid;
    }

    @Override
    public void onClose(String sid) {
    }

    @Override
    public void onMessageBySystem(String senderId, String message) {
        log.info("向系统发送的消息："+message);
    }

    @Override
    public String login(String username, String password) {
        return "";
    }

}
